import request from '@/utils/request'
export const getEnterpriseListApi = (params) => request({
  url: '/park/enterprise',
  params
})

// 查看企业所属行业
export const getIndustryListApi = () => request({
  url: '/park/industry'
})

// 上传接口
export const uploadApi = data => request({
  method: 'post',
  url: '/upload',
  data
})

// 增加企业
export const createEnterpriseApi = (data) => request({
  url: '/park/enterprise',
  method: 'POST',
  data
})
// 查看企业详情
export const getEnterpriseDetailApi = id => request({
  url: `/park/enterprise/${id}`
})
// 编辑企业信息
export const updateEnterpriseApi = data => request({
  method: 'put',
  url: '/park/enterprise',
  data
})
// 删除企业
export const delEnterpriseApi = id => request({
  method: 'delete',
  url: `/park/enterprise/${id}`
})
// 楼宇列表查询
export const getRentBuildListApi = () => request({
  url: '/park/rent/building'
})
// 给企业添加合同
export const createRentApi = data => request({
  method: 'post',
  url: '/park/enterprise/rent',
  data
})
// 获取当前合同列表
export const getRentListApi = id => request({
  url: `/park/enterprise/rent/${id}`
})
// 退租合同
export const outRentAPI = rentId => request({
  method: 'put',
  url: `/park/enterprise/rent/${rentId}`
})
// 下载接口
export const downloadContractApi = id => request({
  url: `/download/${id}`,
  responseType: 'blob'
})
